package com.itheima.Demo01.demo02;

import java.io.*;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.Socket;

public class socket {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1",10000);
        OutputStream os = socket.getOutputStream();
        PrintWriter pw = new PrintWriter(os,true);
        pw.println("五连鞭");
        InputStream stream = socket.getInputStream();
        BufferedReader br =new BufferedReader(new InputStreamReader(stream));
        String s = br.readLine();
        System.out.println(s);
        os.close();
        socket.close();

    }
}
